package com.zzyl.service.impl;

import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.mapper.NursingProjectMapper;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import org.activiti.api.runtime.shared.query.Page;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

public class NursingProjectServiceImpl implements NursingProjectService {

    @Autowired
    private NursingProjectMapper nursingProjectMapper;

    @Override
    public PageResponse<Object> getByPage(String name, Integer status, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum,pageSize);
        List<NursingProjectVo> nursingProjectVos=nursingProjectMapper.selectByPage(name,status,pageNum,pageSize);
        Page<NursingProjectVo> pages = (Page<NursingProjectVo>) nursingProjectVos;
        return PageResponse.of(pages, NursingProjectVo.class);
    }
}
